package com.xnfh.equipment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xnfh.common.bean.EquipmentGlBean
import com.xnfh.equipment.R

/**
 * @Description:气象设备 item
 * @Author: ziheng
 * @CreateDate: 2023/11/2 1:26 PM
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/11/2 1:26 PM
 * @UpdateRemark: 更新说明
 */
class EquipmentGlAdapter: BaseQuickAdapter<EquipmentGlBean,BaseViewHolder>(R.layout.item_equipment_layout) {
    override fun convert(holder: BaseViewHolder, item: EquipmentGlBean) {
        holder.setText(R.id.item_eq_title,item.gatewayName)
        holder.setText(R.id.item_eq_number,"${context.resources.getString(R.string.str_sbbm)}${item.gatewayId}")
        //5304是气象站 ,  5301是土壤水势
        if(item.gatewayModel == "5304"){
            holder.setImageResource(R.id.item_eq_icon,R.mipmap.qx_icon)
        }else{
            holder.setImageResource(R.id.item_eq_icon,R.mipmap.qx_icon_2)
        }
    }
}